<template>
  <div id="app">
    <keep-alive><router-view></router-view></keep-alive>
    <tabNav v-if="showCase && showTab"></tabNav>
  </div>
</template>
<script>
import { getUserInfo } from '@/api/public'
import waterMark from '@/utils/waterMark'
import tabNav from '@/components/tab.vue'
import util from "@/utils/util";
export default {
  components: { tabNav },
  data() {
    return {
      // userName: "",
      showCase: false, //需要动态获取是合规还是非合规状态，默认非合规人员
      showTab: false,
    }
  },
  watch: {
    '$route'(val) {
      this.showTab = false
      if (val.meta.BottomNavShow) {
        this.showTab = true
      }
    }
  },
  mounted() {
    console.log('v8:', new Date());
    util.setCookie('current_time', `v8_${new Date()}`) //每次打包前修改下版本
    this.showCase = this.$store.state.showCase == 1
    this.showTab = false
    if (this.$route.meta.BottomNavShow) {
      this.showTab = true
    }
  },
  methods: {
    // getUserName() {
    //   getUserInfo({
    //     code: "90043"
    //   }).then(res => {
    //     this.userName = res.data.userName + (res.data.mobile ? res.data.mobile : '') || ''
    //     waterMark.set(this.userName)
    //   })
    // }
  }
}
</script>
<style lang="less">
html,
body,
#app {
  height: 100%;
  background: #F5F7FA;
}
</style>